<!DOCTYPE html>
<html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>位置信息</title>
</head>
<body>
<p id="locationInfo">位置信息</p>
<script>
    navigator.geolocation.getCurrentPosition(showPosition);
    var locationInfo=document.getElementById("locationInfo");
    function showPosition(position){
        locationInfo.innerHTML="Latitude: " + position.coords.latitude + "<br />Longitude: " + position.coords.longitude;
    }
</script>
</body>
</html>